<!DOCTYPE html>
<html lang="en">
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>更新用户</title>
    <link rel="stylesheet" href="/js/bootstrap.min.css">
    <script src="/js/jquery-3.2.1.min.js"></script>
    <script src="/js/bootstrap.min.js"></script>
    <script>
        $(function () {
            $("#button").click(function () {
                var newUser = $("#addForm form")[0];
                var formaDate = new FormData(newUser);
                $.ajax({
                    url: "/applets/user/update",
                    type: "post",
                    data: formaDate,
                    contentType: false,
                    processData: false,
                    success: function (data) {
                        alert(data.msg);
                    }
                });
                return false;
            });
        });
    </script>
</head>
<body>
<div class="container" id="addForm">
    <h2 class="text-center">用户修改</h2>

    <!--导航-->
    <ul class="nav nav-tabs">
        <li class="nav-item">
            <a class="nav-link active" href="ShowUser.html">返回展示界面</a>
        </li>
    </ul>


    <form action="#" method="post">
        <div class="form-group">
            <label>ID</label>
            <input type="text" class="form-control" name="id" readonly th:value="${u.id}">
        </div>
        <div class="form-group">
            <label>用户名</label>
            <input type="text" class="form-control" name="wname" th:value="${u.wname}">
        </div>
        <div class="form-group">
            <label>手机号</label>
            <input type="text" class="form-control" name="tele" th:value="${u.tele}">
        </div>
        <div class="form-group">
            <label>OpenId</label>
            <input type="text" class="form-control" name="openid" th:value="${u.openid}">
        </div>
        <div class="form-group">
            <label>密码</label>
            <input type="text" class="form-control" name="upass" th:value="${u.upass}">
        </div>
        <div class="form-group">
            <label>地址</label>
            <input type="text" class="form-control" name="addrid" th:value="${u.addrid}">
        </div>
        <div class="form-group">
            <label>是否可用</label>
            <label class="radio-inline"><input type="radio" name="inuse" value="1" checked>是</label>
            <label class="radio-inline"><input type="radio" name="inuse" value="0" th:checked="${!u.inuse}">否</label>
        </div>
        <div class="form-group">
            <input type="button" class="form-control" id="button" value="提交">
        </div>
    </form>
</div>
</body>
</html>